<?php

use yii\db\Migration;

class m211211_060136_addons extends Migration
{
    public function up()
    {
        /* 取消外键约束 */
        $this->execute('SET foreign_key_checks = 0');
        
        /* 创建表 */
        $this->createTable('{{%addons}}', [
            'mid' => "int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '模块id'",
            'is_nav' => "int(11) NULL COMMENT '是否导航'",
            'identifie' => "varchar(100) NOT NULL COMMENT '英文标识'",
            'type' => "varchar(30) NULL DEFAULT 'base' COMMENT '模块类型'",
            'title' => "varchar(100) NOT NULL COMMENT '名称'",
            'version' => "varchar(15) NOT NULL COMMENT '版本'",
            'ability' => "varchar(500) NOT NULL COMMENT '简介'",
            'description' => "varchar(1000) NOT NULL COMMENT '描述'",
            'author' => "varchar(50) NOT NULL COMMENT '作者'",
            'url' => "varchar(255) NOT NULL COMMENT '社区地址'",
            'settings' => "tinyint(1) NOT NULL DEFAULT '0' COMMENT '配置'",
            'logo' => "varchar(250) NOT NULL COMMENT 'logo'",
            'versions' => "varchar(50) NULL COMMENT '适应的软件版本'",
            'is_install' => "tinyint(1) NULL",
            'PRIMARY KEY (`mid`)'
        ], "ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='扩展模块表'");
        
        /* 索引设置 */
        $this->createIndex('idx_name','{{%addons}}','identifie',0);
        
        
        /* 表数据 */
        $this->insert('{{%addons}}',['mid'=>'128','is_nav'=>NULL,'identifie'=>'diandi_cloud','type'=>'base','title'=>'店滴云','version'=>'1.0','ability'=>'店滴独立模块授权管理系统','description'=>'店滴独立模块授权管理系统','author'=>'chunchun','url'=>'https://www.hopesfire.com/','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_cloud','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'132','is_nav'=>NULL,'identifie'=>'diandi_im','type'=>'base','title'=>'店滴客服','version'=>'1.0','ability'=>'实时在线客服聊天','description'=>'实时在线客服聊天','author'=>'chunchun','url'=>'https://www.hopesfire.com/','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_im','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'133','is_nav'=>NULL,'identifie'=>'diandi_ai','type'=>'base','title'=>'店滴AI','version'=>'1.0','ability'=>'店滴ai','description'=>'人脸识别，OCR认证，人脸会员等','author'=>'王春生','url'=>'http://bbs.wayfirer.com/','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_ai','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'135','is_nav'=>NULL,'identifie'=>'diandi_integral','type'=>'business','title'=>'积分商城','version'=>'0.1','ability'=>'积分商城','description'=>'积分商城','author'=>'tuhuokeji','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_integral','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'136','is_nav'=>NULL,'identifie'=>'diandi_sms','type'=>'marketing','title'=>'店滴短信云','version'=>'1.0','ability'=>'对接各短信平台并进行群发','description'=>'对接各短信平台并进行群发','author'=>'途火科技','url'=>'https://www.hopesfire.com/','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_sms','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'140','is_nav'=>NULL,'identifie'=>'diandi_distribution','type'=>'base','title'=>'店滴分销','version'=>'1.0.0','ability'=>'1','description'=>'分销','author'=>'wanchunsheng','url'=>'www.baidu.com','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_distribution','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'141','is_nav'=>NULL,'identifie'=>'diandi_task','type'=>'base','title'=>'任务调度','version'=>'1.0','ability'=>'结合swoole完成定时任务调度','description'=>'结合swoole完成定时任务调度','author'=>'chunchun','url'=>'https://www.hopesfire.com/','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_task','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'145','is_nav'=>NULL,'identifie'=>'diandi_example','type'=>'base','title'=>'开发文档','version'=>'1.0','ability'=>'店滴官方开发示例','description'=>'店滴各种组件开发示例','author'=>'店滴','url'=>'https://gitee.com/wayfiretech_admin/firetech','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_example','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'147','is_nav'=>NULL,'identifie'=>'diandi_tuan','type'=>'base','title'=>'店滴拼团','version'=>'1.0','ability'=>'店滴拼团','description'=>'店滴拼团','author'=>'店滴','url'=>'https://gitee.com/wayfiretech_admin/firetech','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_tuan','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'149','is_nav'=>NULL,'identifie'=>'diandi_barter','type'=>'base','title'=>'店滴易货','version'=>'1.0','ability'=>'店滴易货','description'=>'店滴易货','author'=>'店滴','url'=>'https://gitee.com/wayfiretech_admin/firetech','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_barter','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'150','is_nav'=>NULL,'identifie'=>'self_help','type'=>'base','title'=>'自助客','version'=>'1.0','ability'=>'液体自动售卖机','description'=>'液体自动售卖机','author'=>'chunchun','url'=>'https://gitee.com/wayfiretech_admin/firetech','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=self_help','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'152','is_nav'=>NULL,'identifie'=>'diandi_shop','type'=>'business','title'=>'店滴点单','version'=>'1.3.8','ability'=>'店滴点单','description'=>'店滴点单','author'=>'tuhuokeji','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_shop','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'154','is_nav'=>NULL,'identifie'=>'diandi_outbound','type'=>'marketing','title'=>'外呼系统','version'=>'1.0','ability'=>'外呼系统','description'=>'外呼系统','author'=>'王春生','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_outbound','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'155','is_nav'=>NULL,'identifie'=>'diandi_slyder','type'=>'marketing','title'=>'大转盘','version'=>'1.0.0','ability'=>'大转盘','description'=>'大转盘活动','author'=>'王春生','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_slyder','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'156','is_nav'=>NULL,'identifie'=>'diandi_website','type'=>'base','title'=>'企业官网','version'=>'1.0.0','ability'=>'企业官网管理','description'=>'','author'=>'','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_website','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'157','is_nav'=>NULL,'identifie'=>'diandi_store','type'=>'business','title'=>'订座','version'=>'1.3.8','ability'=>'订座','description'=>'同城商家快速订座','author'=>'tuhuokeji','url'=>'','settings'=>'0','logo'=>'/backend/addons/addons/logo?addon=diandi_store','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'158','is_nav'=>NULL,'identifie'=>'diandi_qiniu','type'=>'base','title'=>'七牛云存储','version'=>'1.0','ability'=>'七牛云存储','description'=>'七牛云储存','author'=>'店滴','url'=>'https://gitee.com/wayfiretech_admin/firetech','settings'=>'0','logo'=>'F:\\www\\firetech/frontend/web/attachment/diandi_qiniu/logo.png','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'159','is_nav'=>NULL,'identifie'=>'diandi_pro','type'=>'buss','title'=>'产品库维护','version'=>'1.0','ability'=>'1','description'=>'工业产品库维护','author'=>'wangchunsheng','url'=>'http://bbs.wayfirer.com/','settings'=>'0','logo'=>'diandi_pro/logo.png','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'160','is_nav'=>NULL,'identifie'=>'weihai_bigscreen','type'=>'base','title'=>'微嗨数据大屏','version'=>'1.0.0','ability'=>'微嗨数据大屏','description'=>'微嗨数据大屏','author'=>'chunchun','url'=>'','settings'=>'0','logo'=>'','versions'=>NULL,'is_install'=>NULL]);
        $this->insert('{{%addons}}',['mid'=>'162','is_nav'=>NULL,'identifie'=>'diandi_honorary','type'=>'base','title'=>'晓多荣誉墙','version'=>'1.0','ability'=>'晓多荣誉墙','description'=>'晓多荣誉墙','author'=>'王春生','url'=>'','settings'=>'0','logo'=>'','versions'=>NULL,'is_install'=>NULL]);
        
        /* 设置外键约束 */
        $this->execute('SET foreign_key_checks = 1;');
    }

    public function down()
    {
        $this->execute('SET foreign_key_checks = 0');
        /* 删除表 */
        $this->dropTable('{{%addons}}');
        $this->execute('SET foreign_key_checks = 1;');
    }
}

